<!DOCTYPE html>
<html>
  <head>
    <title>featureDetection-form.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
    <link rel="stylesheet" tyle="text/css" href="../css/jquery-ui-1.10.3.custom.min.css">
    <script type="text/javascript" src="../css/jquery-ui-1.10.3.custom.js"></script>
	<script type="text/javascript" src="../javascript/lib/jquery-1.9.1/jquery-1.9.1.min.js"></script>
	<!-- 用于特性检测 -->
	<script type="text/javascript" src="../javascript/lib/plusin/modernizr-1.7.min.js"></script>
	<script type="text/javascript">
		$(function(){
			if(!Modernizr.input.required){
				var $msg = $("<div id='reqMessage'>Required Fields Missing</div>");
				$msg.css("background-color" , "yellow").hide();
				
				$("body").append($msg);
				
				$("#fDet").on("submit" , function(event){
					$("input[required]").each(function(){
						if($(this).val() === ""){
							event.preventDefault();
							$("#reqMessage").show();
							$(this).css("border" , "1px solid red");
						}
					});
				});
			}else{
				alert("ture");				
			}
		})
	</script>
  </head>
  
  <body>
    <form action="#" id=fDet>
    	<input type="text" name="userName" required placeholder="enter your name"/>
    	<input type="password" name="password" required />
    	<input type="submit" value="send it" />
    </form>
  </body>
</html>
